package com.ruoyi.service.entity.item;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.service.domain.ServiceCategory;

import java.util.List;

/**
 * 服务项目及分类列表返回体
 *
 * @author ZDL
 */

@lombok.Data
public class PCCategoryVO {

    /** 项目分类id */
    private Long categoryId;

    /** 项目分类名称 */
    @Excel(name = "项目分类名称")
    private String categoryName;

    /** 关联上级分类 */
    @Excel(name = "关联上级分类")
    private Long categoryLink;

    //分类下子分类
    private List<PCCategoryVO> children;

    //分类下项目及套餐
    private List<PCItemVO> items;
    private Long itemNum;

    private String code;//启用，停用
    private String status;//启用，停用

    public List<PCCategoryVO> getChildren() {
		return children;
	}

    public void setChildren(List<PCCategoryVO> children) {
		this.children = children;
	}


    public void init(ServiceCategory treeNode) {
        this.categoryId = treeNode.getCategoryId();
        this.categoryName = treeNode.getCategoryName();
        this.categoryLink = treeNode.getCategoryLink();
        if ("0".equals(treeNode.getCategoryUseFlag())){
            this.code = "normal";
            this.status = "启用";
        }else {
            this.code = "stop";
            this.status = "停用";
        }
    }
}
